import types from '../mutation-type'
const state = ()=>{data:null}
const getters = {
  getData : state => state.data
}
const actions = {
  setData({commit,dispatch,state},data){
    return new Promise((resolve, reject)=>{
      commit(types.SETHEADER,data);
      resolve(data)
    })
  }
}
const mutations = {
  [types.SETHEADER](state, data){
    state.data = data;
  }
}
export default {
  namespaced: true,
  state,
  getters,
  actions,
  mutations
}